home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / test_lay / readme.txt < prev    next >
Encoding:
Text File  |  1994-05-18  |  5.4 KB  |  181 lines

  1. ----------------
  2. TestLay Overview
  3. ----------------
  4.  
  5. Program TestLay demonstrates how to save a TrueGrid layout then 
  6. restore it.  A TrueGrid layout consists of a long binary string 
  7. which contains information used to describe what data is contained 
  8. in each column, heading information, format, etc.  The user can, at 
  9. "run time", change some of these setting, primarily column width 
  10. and column location.
  11.  
  12. After the user has painstakingly setup the grid the way he wants to 
  13. see it then it would be nice to restore those settings the next 
  14. time the user starts the application.  And since the user could 
  15. really mess up the grid, it would me nice to give him a quick way 
  16. to restore the "factory settings."
  17.  
  18. ---------------------
  19. Grid Layout Functions
  20. ---------------------
  21.  
  22. We have created two VB Functions to perform the task of saving and 
  23. restoring the layouts.  They are contained in file TGLayout.Bas
  24.  
  25. The Functions are:
  26.  
  27. Function GridGetLayout (TheFile As String, Which As String, What As 
  28. String, TheGrid As Control) As Integer
  29.  
  30. Function GridSaveLayout (TheFile As String, Which As String, What 
  31. As String, TheGrid As Control) As Integer
  32.  
  33. Where:
  34.  
  35. TheFile is the full file name and path where the layout information 
  36. should be saved.  TheFile can contain many layouts.  They are 
  37. identified by Which and What.
  38.  
  39. Which and What are used to identify the layout for TheGrid.  For 
  40. example: Which=TestLay, What=Factory and Which=TestLay, 
  41. What=Current would cause two layouts to be saved.  There is no 
  42. limit to the number of layouts that can be saved in TheFile. 
  43.  
  44. ----------------------
  45. How The Functions Work
  46. ----------------------
  47.  
  48. The GridSaveLayout function:
  49.  
  50. 1. Gets a temporary file name.
  51. 2. Opens for Binary the temporary file.
  52. 3. Opens for Binary TheFile, the exiting file if any.
  53. 4. Reads an existing layout from TheFile.
  54. 5. If a match is made then the new layout information is saved, if 
  55. it is different, otherwise, the existing layout is written to 
  56. the temporary file.
  57. 6. Loop through all the existing layouts.  If no match is found 
  58. then the new layout is appended to the end of the temporary 
  59. file.
  60. 7. Close the files.
  61. 8. The return code is set to True if the new layout was saved or 
  62. replaced.  The return code is set to False if it was not saved 
  63. or was the same as the one previously saved.
  64. 9. Replace the TheFile with the temporary file using the VB 
  65. FileCopy statement.
  66. 10. Kill the temporary file.
  67.  
  68. The GridGetLayout function:
  69.  
  70. 1. Open the TheFile.
  71. 2. Search TheFile for the desired layout.
  72. 3. If found, and if it is different from the existing setting set 
  73. the grid's layout [Table1.Layout=FoundLayout], set the return 
  74. code to True then exit.
  75. 4. If found, and is the same as the existing layout, set the return 
  76. code to False then exit.
  77. 5. If not found then set the return code to False then exit.
  78.  
  79. ---------------------------------
  80. User Defined Type: TrueGridLayout
  81. ---------------------------------
  82.  
  83. The following VB user defined type is used.  Notice that the date 
  84. and time are stored with the layout.
  85.  
  86. Type TrueGridLayout
  87.     WhichLen As Integer 'length of which
  88.     Which As String     'which grid, TablePeople, etc.
  89.     TypeLen As Integer  'length of type
  90.     Type As String      'Factory or Current, could be anything
  91.     LastUpdatedLen As Integer   'length of date and time
  92.     LastUpdated As String       'last updated, date and time
  93.     ValueLen As Integer 'length of the layout
  94.     Value As Variant    'the layout, 2000 or more characters
  95. End Type
  96.  
  97. ----------------
  98. The Demo Program
  99. ----------------
  100.  
  101. Project file TestLay.Mak demonstrates the use of a very simple 
  102. grid, and saving and restoring the grid settings.
  103.  
  104. The TestLay.Mak file:
  105.  
  106. TESTLAY.FRM    Demo VB Form
  107. TESTLAY.FRX    Binary Info
  108. TRUEGRID.VBX    TrueGrid VBX, not supplied with this demo
  109. TGLAYOUT.BAS    The Functions
  110. TESTLAY.BAS    Used by the Demo Program, change these
  111. ProjWinSize=15,516,235,388
  112. ProjWinShow=2
  113. IconForm="Form1"
  114. Title="Test Grid Layout"
  115. ExeName="TESTLAY.EXE"
  116.  
  117. ----------------
  118. Other Components
  119. ----------------
  120.  
  121. TestLay.Exe    An executable, requires truegrid.vbx
  122. TestLay.Mdb    Sample Database used by the demo.
  123. TestLay.Ldb    Lock Database info, not needed
  124. TestLay.Ico    Icon used by the demo
  125. ReadMe.Txt    This read me file.
  126.  
  127. --------
  128. Freeware
  129. --------
  130.  
  131. These software items are presented as Freeware.  There is no charge 
  132. for the use of the software.  There is no warranty.  Use the 
  133. software at your own risk.
  134.  
  135. ------------------------------
  136. Other Software from The Bridge
  137. ------------------------------
  138.  
  139. MsgBox3D - A replacement for VB message box.  Download MsgB3D.Zip 
  140. from CompuServe.  $4.95
  141.  
  142. Space Calendar - A small, compact calendar with holiday schedules 
  143. in an Access database.  Download SpaCln.Zip.  $19.95
  144.  
  145. ------
  146. Author
  147. ------
  148.  
  149. If you have questions, problems, or suggestions, please contact:
  150.  
  151. Larry Rebich
  152. The Bridge, Inc.
  153. 199 California Drive, Suite 210
  154. Millbrae, CA  94030
  155. 415-697-2730
  156. Fax: 415-692-3921
  157. CompuServe: 71662,205
  158.  
  159. ----------------------
  160. Version 1.00, 94/05/18
  161. ----------------------
  162.  
  163. Original version completed.  A demo was uploaded to CompuServe on 
  164. 94/05/18.
  165.  
  166. -------
  167. Credits
  168. -------
  169.  
  170. TrueGrid is a proprietary product, trademarked by Apex Software 
  171. Corporation.  Address:
  172.  
  173. Apex Software Corporation
  174. 4516 Henry Street
  175. Pittsburgh, PA 1213
  176. CompuServe: 71053,1062
  177. Sales: 800-858-APEX
  178. Phone: 412-681-4738
  179. Fax: 412-681-4384
  180.  
  181.